<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="invAjuste" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{invAjusteHome.managed ? '' : ''} Ajustes de bodega</f:facet>


           
            <s:decorate id="subdepCodigoField" template="layout/edit.xhtml">
                <ui:define name="label">Bodega</ui:define>
                <h:selectOneMenu value="#{invAjusteHome.instance.auxsubDep}" style="height : 19px; width : 252px;"
                        defaultLabel="Seleccione..." directInputSuggestions="true"
                        enableManualInput="false">
                        <f:selectItems value="#{grupoListado.bodegaSelectItems}" />
                    </h:selectOneMenu>
            </s:decorate>


            <s:decorate id="ajuDocumentoField" template="layout/edit.xhtml">
                <ui:define name="label">Tipo de Transaccion</ui:define>
                
           <h:selectOneMenu value="#{invAjusteHome.instance.ajuTipo}" style="height : 19px; width : 252px;"
                        defaultLabel="Seleccione..." directInputSuggestions="true"
                        enableManualInput="false">
                        <f:selectItems value="#{grupoListado.tipoDeTransaccionSelectItems}" />
                    </h:selectOneMenu>
                
            </s:decorate>
            
          <s:decorate id="ajuTipoField" template="layout/edit.xhtml">
                <ui:define name="label">Tipo de ajuste</ui:define>
                
                <h:selectOneMenu value="#{invAjusteHome.instance.ajuTipoDeDocumento}" style="height : 19px; width : 252px;"
                        defaultLabel="Seleccione..." directInputSuggestions="true"
                        enableManualInput="false">
                        <f:selectItems value="#{grupoListado.tipoDeDatoSelectItems}" />
                    </h:selectOneMenu>
            </s:decorate>
            
            <s:decorate id="ajuValorField" template="layout/edit.xhtml">
                <ui:define name="label">Valor a cambiar</ui:define>
                <h:inputText id="ajuValor"
                          value="#{invAjusteHome.instance.ajuValor}"
                           size="17">
                    <a:support event="onblur" reRender="ajuValorField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>

<s:decorate id="cmpCodigoField" template="layout/edit.xhtml">
                <ui:define name="label">Identificador tipo de Transaccion:</ui:define>
                <h:inputText id="cmpCodigo"
                       required="true"
                       disabled="#{invComprasHome.managed}"
                          value="#{invAjusteHome.instance.ajuDocumento}">
                    <a:support event="onblur" reRender="cmpCodigoField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>
            
            <s:decorate id="cmpCodigoField3" template="layout/edit.xhtml">
                <ui:define name="label">Grupo:</ui:define>
             
             <h:selectOneMenu value="#{invAjusteHome.instance.ajuGrupo}">
                    
    <f:selectItems value="#{grupoListado.grupoSelectItems}"  />
     <a:support event="onchange" reRender="Comboitems" ajaxSingle="true" />
    </h:selectOneMenu>
            </s:decorate>
            
             <s:decorate id="cmpCodigoField1" template="layout/edit.xhtml">
                <ui:define name="label">Items:</ui:define>
             
            <h:selectOneMenu id="Comboitems" value ="#{invAjusteHome.instance.ajuItem}" >
                    <f:selectItems value="#{grupoListado.listaItemsSelectItems}"  />
                    </h:selectOneMenu>
            </s:decorate>
            
<s:decorate id="ajuFechaField" template="layout/edit.xhtml">
                <ui:define name="label">Fecha</ui:define>
                <rich:calendar id="ajuFecha"
                       required="true"
                          value="#{invAjusteHome.instance.ajuFecha}" datePattern="MM/dd/yyyy" />
            </s:decorate>

            


<s:decorate id="ajuObservacionField" template="layout/edit.xhtml">
                <ui:define name="label">Observaciones</ui:define>
                <h:inputText id="ajuObservacion"
                           size="100"
                      maxlength="100"
                          value="#{invAjusteHome.instance.ajuObservacion}">
                    <a:support event="onblur" reRender="ajuObservacionField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>
            <div style="clear:both">
                <span class="required">*</span>
                campos requeridos
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Ajustar"
                         action="#{invAjusteHome.persist}"
                       disabled="#{!invAjusteHome.wired}"
                       rendered="#{!invAjusteHome.managed}"/>


            <s:button id="cancelEdit"
                   value="Cancelar"
             propagation="end"
                    view="/home.xhtml"
                />



        </div>
    </h:form>
</ui:define>

</ui:composition>
